/* 
 * File:   SupportVectorMachine.h
 * Author: ungerma
 *
 * Created on 04. August 2014, 15:30
 */

#ifndef SUPPORTVECTORMACHINE_H
#define	SUPPORTVECTORMACHINE_H

#include <cstdlib>
#include <cstdio>
#include <exception>
#include <stdexcept>
#include <iostream>
#include <fstream>

#include "opencv2/opencv.hpp"

#include "Images.h"
#include "TestResults.h"
#include "HOGSettings.h"

using namespace cv;

class SupportVectorMachine {
public:
    
    SupportVectorMachine();
    SupportVectorMachine(HOGSettings settings);
    
    void train(string exe, string featureFile, string svmFile, 
         string svmParameters);
    TestResults classify(string exe, string featureFile, string modelFile,
        string clzFile, Images& images);
    
protected:
    
    void readNextLines(TestResults& results,vector<SingleImage> sis, 
            float groundTruth, ifstream& file );
    vector<float> deserializePrimalForm(string filename);
    HOGSettings settings;
    
};

#endif	/* SUPPORTVECTORMACHINE_H */
